interface DBI {
  // 插入
  insert<T>(collectionName: string, doc: T): Promise<boolean>;

  // 批量插入
  insertMany<T>(collectionName: string, docs: T[]): Promise<boolean>;

  // 删除
  delete(collectionName: string, filter: object): Promise<boolean>;

  // 更新
  update(
    collectionName: string,
    filter: object,
    update: object
  ): Promise<boolean>;

  // 查找
  find(collectionName: string, filter: object): Promise<any[]>;

  // 高级查找
  aggregate(collectionName: string, pipeline: object[]): Promise<any[]>;
}

export { DBI };
